<template>
  <el-dialog
    :visible.sync="$attrs.visable"
    width="600px"
    :before-close="handleClose"
    append-to-body
    title="添加到素材库"
    :show-close="false"
    :close-on-click-modal="false"
  >
    <template slot="title">
      <div class="flexbetween">
        <div class="f-14 c_text2">行为轨迹</div>
        <div class="f-12 c_text3">保留近1个月且在线期间的记录</div>
      </div>
    </template>
    <el-select v-model="queryParams.keyword" placeholder="请选择" class="mb-8">
      <el-option
        v-for="item in options"
        :key="item.id"
        :label="item.name"
        :value="item.id"
      >
      </el-option>
    </el-select>
    <div class="bodybox bg_f7f7f7">
      <el-timeline class="timelinemy">
        <el-timeline-item
          v-for="(activity, index) in activities"
          :key="index"
          :timestamp="activity.timestamp"
          color="#3b74ff"
        >
          {{ activity.content }}
        </el-timeline-item>
      </el-timeline>

      <pagination
        class="flexcenter"
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
        layout="prev, pager, next"
      />
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" type="primary" @click="handleClose"
        >关 闭</el-button
      >
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      total:3,
      queryParams:{
        pageNum:1,
        pageSize:10,
        keyword:''
      },
      options: [
        { name: "全部", id: 1 },
        { name: "标签变更", id: 2 },
        { name: "群变更", id: 3 },
        { name: "其它", id: 4 },
      ],
      activities: [
        {
          content: "活动按期开始",
          timestamp: "2018-04-15",
        },
        {
          content: "通过审核",
          timestamp: "2018-04-13",
        },
        {
          content: "创建成功",
          timestamp: "2018-04-11",
        },
      ],
    };
  },
  methods: {
    handleClose() {
      this.$emit("close"); //关闭弹窗;
    },

    handleAddLable() {
      if (this.form.name) {
        if (this.form.labels.includes(this.form.name)) {
          this.$message.warning("标签重复");
          return;
        }
        this.form.labels.push(this.form.name);
        this.form.name = "";
      }
    },

    removeLable(index) {
      this.form.labels.splice(index, 1);
    },

    handleSubmit() {},
  },
};
</script>
<style lang="scss" scoped>
.bodybox {
  padding: 20px 12px;
}
.timelinemy {
  ::v-deep .el-timeline-item__node--normal {
    left: 1px;
    width: 8px;
    height: 8px;
  }
  ::v-deep .el-timeline-item__tail {
    top: 20%;
    height: 70%;
  }
}
.pagination-container{
  background-color: transparent;
  .el-pagination{
    position: initial;
  }
}
</style>